﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAO;

namespace UI.Models
{
    public class CategoryModel
    {
        DaoRepository dr = new DaoRepository();

        static CategoryModel cm;

        public static CategoryModel GetInstance()
        {
            if (cm == null)
            {
                cm = new CategoryModel();
            }
            return cm;
        }

        public IEnumerable<Category> GetAll()
        {
            return dr.CategoryRepository.GetAll();
        }

        public Category GetById(int id)
        {
            return dr.CategoryRepository.GetById(id);
        }
    }
}